package com.bk.bookviews.common;

import com.bk.bookviews.domain.ResultMsg;

import java.io.Serializable;
import java.util.List;

public class Pagination extends ResultMsg implements Serializable {

    //数据列表
    private List data;

    //分页信息
    private PageInfo pageInfo;

    public Pagination(List data){
        this.data = data;
    }

    public Pagination(){

    }

    @Override
    public List getData() {
        return data;
    }

    public void setData(List data) {
        this.data = data;
    }

    public void setPageInfo(PageInfo pageInfo) {
        this.pageInfo = pageInfo;
    }

    public PageInfo getPageInfo() {
        return pageInfo;
    }

    public class PageInfo implements Serializable{
        //总条数
        private long total;
        //页数
        private int pageNum;

        //每页条数
        private int pageSize;

        public PageInfo(long total, int pageNum, int pageSize) {
            this.total = total;
            this.pageNum = pageNum;
            this.pageSize = pageSize;
        }

        public long getTotal() {
            return total;
        }

        public void setTotal(long total) {
            this.total = total;
        }

        public int getPageNum() {
            return pageNum;
        }

        public void setPageNum(int pageNum) {
            this.pageNum = pageNum;
        }

        public int getPageSize() {
            return pageSize;
        }

        public void setPageSize(int pageSize) {
            this.pageSize = pageSize;
        }
    }
}
